﻿using System.Windows;

namespace BaseTypesControlLib.Controls
{
    //editable and readonly are for styles
    public class ButtonFieldControl:FieldControl
    {
        public ButtonFieldControl()
        {
            DefaultStyleKey = typeof(ButtonFieldControl);
        }

        static ButtonFieldControl()
        {
            FrameworkPropertyMetadata fpm = new FrameworkPropertyMetadata(null,
                FrameworkPropertyMetadataOptions.AffectsMeasure |
                FrameworkPropertyMetadataOptions.AffectsArrange);
            LabelProperty = DependencyProperty.Register("Label", typeof(string),
                typeof(ButtonFieldControl), fpm);

            fpm = new FrameworkPropertyMetadata(true,
                FrameworkPropertyMetadataOptions.AffectsMeasure |
                FrameworkPropertyMetadataOptions.AffectsArrange);
            EditableProperty = DependencyProperty.Register("Editable", typeof(bool),
                typeof(ButtonFieldControl), fpm);

            fpm = new FrameworkPropertyMetadata(true,
                FrameworkPropertyMetadataOptions.AffectsMeasure |
                FrameworkPropertyMetadataOptions.AffectsArrange);
            ReadOnlyProperty = DependencyProperty.Register("ReadOnly", typeof(bool),
                typeof(ButtonFieldControl), fpm);

        }

        public string Label
        {
            get { return (string)GetValue(LabelProperty); }
            set { SetValue(LabelProperty, value); }
        }
        public static readonly DependencyProperty LabelProperty;

        public bool Editable
        {
            get { return (bool)GetValue(EditableProperty); }
            set { SetValue(EditableProperty, value); }
        }
        public static readonly DependencyProperty EditableProperty;

        public bool ReadOnly
        {
            get { return (bool)GetValue(ReadOnlyProperty); }
            set { SetValue(ReadOnlyProperty, value); }
        }
        public static readonly DependencyProperty ReadOnlyProperty;


    }
}
